package persistent;


/**
 * 
 * A simple record of drug recommendations.
 * 
 * Design tweak from earlier Milestones: we now treat prescriptions just like those little pieces of paper they hand out.
 * We had originally kept a list of prescriptions in the database and given each prescription a treatment record reference.
 * With db4o this is unnecessary, and we might as well treat them like the throwaway objects they are. (db4o saves/retrieves structured objects and collections automagically)
 * @author Winfred Nadeau
 *
 */
public class Prescription extends Record {
	/** dosage in milligrams **/
	private int dosage;
	private String drug;
	private String directions;
	private TreatmentRecord originatingDiagnosis;
	
	public Prescription(String drug, int dosage, TreatmentRecord originatingDiagnosis){
		this(drug,dosage,"", originatingDiagnosis);
	}
	public Prescription(String drug, int dosage, String directions, TreatmentRecord originatingDiagnosis){
		super();
		this.dosage = dosage;
		this.drug = drug;
		this.directions = directions;
		this.originatingDiagnosis = originatingDiagnosis;
	}
	
	/* This empty constructor is for object-retrieval purposes */
	public Prescription(){
		
	}
	
	public int getDosage() {
		return dosage;
	}
	public void setDosage(int dosage) {
		this.dosage = dosage;
	}
	public String getDrug() {
		return drug;
	}
	public void setDrug(String drug) {
		this.drug = drug;
	}
	public String getDirections() {
		return directions;
	}
	public void setDirections(String directions) {
		this.directions = directions;
	}
	public TreatmentRecord getOriginatingDiagnosis() {
		return originatingDiagnosis;
	}
	public void setOriginatingDiagnosis(TreatmentRecord originatingDiagnosis) {
		this.originatingDiagnosis = originatingDiagnosis;
	}
	

}
